﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once        
#include "IFamilyDimensionConstraint.h"
#include "GmFamilyService.h"

namespace gfam
{

    /// \brief  等比距离约束
    class GM_FAMILY_SERVICE_EXPORT IFamilyDistanceRatioConstraint : public IFamilyDimensionConstraint
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyDistanceRatioConstraint, gfam::IFamilyDimensionConstraint)
    public:

        /// \brief  创建等比距离约束
        ///
        /// \param  pDocument  文档
        /// \param  sketchId 草图id
        /// \param  sketchPlaneId 草图平面id
        /// \param  ownerId 拥有者id (目前只支持IFamilyMultiDistanceDimension类)
        /// \param  coord 坐标系
        /// \param  option  创建选项
        /// \return 等比距离约束
        static IFamilyDistanceRatioConstraint *Create(
            gcmp::IDocument* pDocument
            , const gcmp::ElementId &sketchId
            , const gcmp::ElementId &sketchPlaneId
            , const gcmp::ElementId &ownerId
            , const gcmp::Coordinate3d &coord
            , gcmp::ElementCreationOptions option = gcmp::ElementCreationOptions::Normal
        );

        /// \brief  设置比例值
        ///
        /// \param  ratioValue  比例值
        virtual void SetRatioValue(double ratioValue) = 0;

        /// \brief  获取比例值
        ///
        /// \return  比例值
        virtual double GetRatioValue() const = 0;

        /// \brief  获取是否是投影距离
        ///
        /// \return 投影距离返回true，否则返回false
        virtual bool IsProjDistance() const = 0;

        /// \brief  设置拥有者id (目前只支持IFamilyMultiDistanceDimension类)
        ///
        /// \param ownerId  拥有者id
        virtual void SetOwnerId(const gcmp::ElementId& ownerId) = 0;

        /// \brief  获取拥有者id (目前只支持IFamilyMultiDistanceDimension类)
        ///
        /// \return 拥有者id
        virtual gcmp::ElementId GetOwnerId() const = 0;
    };
}